using UnityEngine;
using System.Collections;

public class AtlasJogo : MonoBehaviour 
{
    public static Texture2D globalTexture;
    public static Rect[] rects;
    private Texture2D[] textures;

    public static Material globalMaterial;

    void Awake()
    {
        textures = new Texture2D[4];
		
		this.textures[0] = ((Texture2D)Resources.Load("Textures/Game/Favela"));
		this.textures[1] = ((Texture2D)Resources.Load("Textures/Game/Lixo"));
		this.textures[2] = ((Texture2D)Resources.Load("Textures/Game/Buraco"));
		this.textures[3] = ((Texture2D)Resources.Load("Textures/Game/Lixeira"));
		
        globalTexture = AtlasTexture.Create(this.textures, out rects);

        globalMaterial = new Material((Shader)Resources.Load("Shader/Basic2D"));
        globalMaterial.mainTexture = globalTexture;
    }
}
